package com.hadwinling.blog.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.hadwinling.blog.mapper.MessageMapper;
import com.hadwinling.blog.entity.Message;
import com.hadwinling.blog.service.MessageService;

import java.util.List;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.service.impl
 * @date 2020/9/13 12:52
 */
@Service
public class MessageServiceImpl implements MessageService {

    @Resource
    private MessageMapper messageMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return messageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Message record) {
        return messageMapper.insert(record);
    }

    @Override
    public int insertSelective(Message record) {
        return messageMapper.insertSelective(record);
    }

    @Override
    public Message selectByPrimaryKey(Integer id) {
        return messageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Message record) {
        return messageMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Message record) {
        return messageMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Message> selectAllByAdminidAndState(Integer adminid, Integer state) {
        return messageMapper.selectAllByAdminidAndState(adminid, state);
    }

    @Override
    public List<Message> selectAllByAdminidAndStateAndIsread(Integer adminid, Integer state, Integer isread) {
        return messageMapper.selectAllByAdminidAndStateAndIsread(adminid, state, isread);
    }

    @Override
    public Integer countByAdminidAndIsreadAndState(Integer adminid, Integer isread, Integer state) {
        return messageMapper.countByAdminidAndIsreadAndState(adminid, isread, state);
    }

    @Override
    public List<Message> selectAllByAdminidAndIsreadAndStateOrderByCreatetimeDesc(Integer adminid, Integer isread, Integer state) {
        return messageMapper.selectAllByAdminidAndIsreadAndStateOrderByCreatetimeDesc(adminid, isread, state);
    }


}




